﻿<UserControl x:Class="GrooveSharp.TrackPopupInfo"
             xmlns:local="clr-namespace:GrooveSharp"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <Grid>
        <Border BorderThickness="2" BorderBrush="Red" Padding="5">
            <StackPanel Orientation="Vertical" >
                <TextBlock Name="selectedTrack" Foreground="White">
                    D Y N A M I C
                </TextBlock>

                <ListView Name="listViewTrackInfo" SelectionMode="Single">

                    <ListView.ItemContainerStyle>
                        <Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource GrooveSharpListViewItem}" />
                    </ListView.ItemContainerStyle>

                    <ListView.View>
                        <GridView>
                            <GridView.Columns>
                                <GridViewColumn Header="Play Date/time" DisplayMemberBinding="{Binding PlayDate}"  />
                                <GridViewColumn Header="Duration"  DisplayMemberBinding="{Binding Span}" />
                                <GridViewColumn Header="Rating" >
                                    <GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <local:Rating RatingValue="{Binding Path=Rating, Mode=TwoWay}" IsEnabled="False" />
                                        </DataTemplate>
                                    </GridViewColumn.CellTemplate>
                                </GridViewColumn>
                            </GridView.Columns>
                        </GridView>
                    </ListView.View>

                </ListView>

                <Border BorderThickness="1" BorderBrush="LightGray" Padding="5" Height="80">

                    <DockPanel LastChildFill="True">
                        <Label DockPanel.Dock="Bottom" Name="labelTrackId" VerticalAlignment="Top" Foreground="#FFF7FAF5" FontSize="9" ></Label>
                        <ItemsControl Name="checkListBox">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <CheckBox 
                                            Content="{Binding Name}" 
                                            IsChecked="{Binding Flagged}" 
                                            ToolTip="{Binding Explanation}" 
                                            Margin="1" 
                                            Focusable="True" FocusVisualStyle="{DynamicResource CheckListBoxFocus}" 
                                            Checked="CheckBox_Checked" 
                                            Unchecked="CheckBox_Unchecked" >
                                        </CheckBox>
                                    </StackPanel>
                                </DataTemplate>

                            </ItemsControl.ItemTemplate>
                            <!--.ColumnSpan="2"-->
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <WrapPanel ItemWidth="100" Orientation="Vertical" />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                        </ItemsControl>
                    </DockPanel>
                </Border>

            </StackPanel>
        </Border>
    </Grid>
</UserControl>
